<?php
/**
 * BackendController is the customized base controller class.
 * All backend controller classes for this application should extend from this base class.
 * @author QuangNghia
 */
class BController extends RController
{
	/**
	 * @var string the default layout for the controller view. Defaults to '//layouts/backend-1-column',
	 * meaning using a single column layout. See 'protected/views/layouts/backend-1-column.php'.
	 */
	public $layout='//layouts/backend-dataform';
	
	/* Ajax function used in view admin */
	public function actionPageSize($pageSize)
	{
		Yii::app()->session['backendPageSize'] = $pageSize;
	}
	
	public function init()
	{
		parent::init();
		Yii::app()->theme = 'backend';
		
		Yii::app()->setComponents(array(
			'errorHandler'=>array(
				'errorAction'=>'backend/default/error',
		)));		
	}
}